package com.User.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.io.Serializable;
import java.util.Objects;

@TableName(value = "user")
public class User implements Serializable {
    private static final long serialVersionUID = 1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    private String username;
    private String nickname;
    private String password;
    private String email;
    private String companyOrSchool;
    private String identity;
    private String signature;
    @TableField("headSculpture")
    private String headSculpture;
    @TableField(exist = false)
    private String headSculptureUrl;
    public User() {
    }

    public String getUsername() {
        return username;
    }


    // 登录状态

    public void setUsername(String username) {
        this.username = username;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getNickname() {
        return nickname;
    }

    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    public String getHeadSculpture() {
        return headSculpture;
    }

    public void setHeadSculpture(String headSculpture) {
        this.headSculpture = headSculpture;
    }

    public String getHeadSculptureUrl() {
        return headSculptureUrl;
    }

    public void setHeadSculptureUrl(String headSculptureUrl) {
        this.headSculptureUrl = headSculptureUrl;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCompanyOrSchool() {
        return companyOrSchool;
    }

    public void setCompanyOrSchool(String companyOrSchool) {
        this.companyOrSchool = companyOrSchool;
    }

    public String getIdentity() {
        return identity;
    }

    public void setIdentity(String identity) {
        this.identity = identity;
    }

    public String getSignature() {
        return signature;
    }

    public void setSignature(String signature) {
        this.signature = signature;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", username='" + username + '\'' +
                ", nickname='" + nickname + '\'' +
                ", password='" + password + '\'' +
                ", email='" + email + '\'' +
                ", companyOrSchool='" + companyOrSchool + '\'' +
                ", identity='" + identity + '\'' +
                ", signature='" + signature + '\'' +
                ", headSculpture='" + headSculpture + '\'' +
                ", headSculptureUrl='" + headSculptureUrl + '\'' +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return Objects.equals(id, user.id) && Objects.equals(username, user.username) && Objects.equals(nickname, user.nickname) && Objects.equals(password, user.password) && Objects.equals(email, user.email) && Objects.equals(companyOrSchool, user.companyOrSchool) && Objects.equals(identity, user.identity) && Objects.equals(signature, user.signature) && Objects.equals(headSculpture, user.headSculpture) && Objects.equals(headSculptureUrl, user.headSculptureUrl);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, username, nickname, password, email, companyOrSchool, identity, signature, headSculpture, headSculptureUrl);
    }
}